package biz.core.service.impl;

import java.util.List;

import biz.core.dao.UserDAO;
import biz.core.domain.User;
import biz.core.exception.DAOException;
import biz.core.exception.ServiceException;
import biz.core.service.UserService;

public class UserServiceImpl implements UserService{
	private UserDAO userDAO;

	public List<User> findAll() throws ServiceException {
		try {
			return userDAO.findAll();
		} catch (DAOException e) {
			throw new ServiceException(e.getMessage(), e);
		}
	}

	public User findById(int id) throws ServiceException {
		try {
			return userDAO.findById(id);
		} catch (DAOException e) {
			throw new ServiceException(e.getMessage(), e);
		}
	}

	public UserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}
	
	

}
